package com.finalProject;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import com.finalProject.R;

/**
 * author: Jimmmy Smile
 * date: 2021-06-09 19:20::20
 * positioan: com.example.empty_try
 * e-mail:jimmysmileltl@163.com
 **/
public class FragmentAdapter extends FragmentStateAdapter {

    public FragmentAdapter(@NonNull FragmentActivity fa) {
        super(fa);
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        if(position==0){
            return new Fragment_First();
        }else if(position==1){
            return new Fragment_Second();
        }else{
            return new Fragment_Third();
        }
    }

    @Override
    public int getItemCount() {
        return 3;
    }
    
}